Repository navigation
common: add @ethdebug/common (Raw, Machine, keccak256) - #413
Merged
Merged
Conversation
Contributor
|
gnidan
force-pushed
the
common-package
branch
from
November 16, 2026 22:00
1a51c85 to
3085791
Compare
gnidan
marked this pull request as ready for review
November 16, 2026 22:36
# Conflicts: # packages/pointers/CHANGELOG.md # packages/pointers/src/dereference/region.ts # schemas/type/elementary/fixed.schema.yaml # schemas/type/elementary/ufixed.schema.yaml
evm no longer imports @ethdebug/pointers, and pointers uses ethereum-cryptography only in a test. RELEASING.md now counts common.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a new package,
packages/common(@ethdebug/common), for runtime code that the ethdebug packages share. The codec needs pointers' low-level byte and machine code without pulling in pointers' dereference logic, and@ethdebug/formatstays types and guards only, so that code moves here.@ethdebug/commonhas:Raw, which replaces theDataclass from@ethdebug/pointers. ARawis a plainUint8Array; the old methods are now functions in theRawnamespace with the same names and behavior (Raw.toHex(raw),Raw.asUint(raw),Raw.fromHex(hex),Raw.resizeTo(raw, n), and so on).Data.fromBytesis gone, because anyUint8Arrayis aRaw.Raw.concatcopies the bytes directly instead of going through hex strings; the output is the same.Machineinterfaces, moved from@ethdebug/pointers, with everyDatanowRaw.keccak256(raw), which pointers'evaluateand the evm executor now use.Every package now uses these from
@ethdebug/common. Nothing ofDatais left.Breaking changes
@ethdebug/pointersno longer exportsDataorMachine, and does not re-export them. ImportRawandMachinefrom@ethdebug/common, and replacedata.toHex()withRaw.toHex(data)(and so on for the other methods).@ethdebug/evm's machine reads giveRawvalues.@ethdebug/pointers-reactno longer re-exports any types: notDataandMachinefrom@ethdebug/pointers, and notPointerfrom@ethdebug/formatorCursorfrom@ethdebug/pointers(pointers-react: drop the Pointer and Cursor re-exports #415). Import each from the package that defines it.Docs and schemas
The "Data and machines" page in the pointers implementation guide keeps its URL, is now titled "Raw bytes and machines", and lists the code from
@ethdebug/common. The other pages that namedDatanow nameRaw. The fixed-point type schemas now say "unscaled value" where they said "raw value", so that "raw" means bytes only.Release note
npm trusted publishing needs a package to exist on the registry before it can be configured. The first publish of
@ethdebug/commonmust be done by hand, and the trusted publisher added on npmjs.com afterward, before the release workflow can publish it.